package com.adcc.swingui.demo.set.model;

import org.apache.log4j.PropertyConfigurator;

import com.adcc.swingui.serialize.AbstractSeriObject;
import com.adcc.swingui.serialize.SerializeObjectFactory;

public class SetUplinkModel extends AbstractSeriObject {
	/**
	 * 每次修改必须要改变版本号，  然后重新使用默认值保存
	 */
	private static final long serialVersionUID = 2L;

	private String uplinkTimeOut;
	
	public SetUplinkModel() {
		//初始化的时候，加载默认值
		restoreDefault();
	}
	public String getUplinkTimeOut() {
		return uplinkTimeOut;
	}

	public void setUplinkTimeOut(String uplinkTimeOut) {
		this.uplinkTimeOut = uplinkTimeOut;
	}

	@Override
	public void restoreDefault() {
		uplinkTimeOut = "5";
	}
	
	public static void main(String[] args) {
		//测试序列化
		PropertyConfigurator.configure(System.getProperty("user.dir")
				+ "/conf/log4j.properties");
		SetUplinkModel obj = (SetUplinkModel) SerializeObjectFactory.getSerializeObject(
				SetUplinkModel.class.getName(), "admin");
		System.out.println(obj.getUplinkTimeOut());
		obj.setUplinkTimeOut("2");
		obj.setPropertyChange(true);
		SerializeObjectFactory.saveAllSerializeObject();
	}
}
